<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorate="main">
<head>
    <meta charset="UTF-8">
    <title>新增角色信息</title>
    <script th:src="@{/js/jquery.min.js}" src="../static/js/jquery.min.js"></script>
</head>
<body>
<div layout:fragment="content">
    <div class="clearfix"></div>
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>新增角色信息<i class="fa fa-user"></i></h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <div class="clearfix"></div>
                    <form class="form-horizontal form-label-left" th:action="@{/role/save}" action="list.html"
                          method="post">
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">角色名称 <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="roleName" class="form-control col-md-7 col-xs-12"
                                       data-validate-length-range="20" data-validate-words="1" name="roleName"
                                       required="required"
                                       placeholder="请输入角色名称" type="text">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">角色描述&nbsp;&nbsp;</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <textarea id="roleDesc" name="roleDesc"
                                          class="form-control col-md-7 col-xs-12" rows="5" placeholder="请输入角色描述"></textarea>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">角色状态<span class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12" style="padding-top: 7px">
                                <input type="checkbox" name="roleFlag" value="1" />(选中可用)
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">指派权限&nbsp;&nbsp;</label>
                            <div class="col-md-6 col-sm-6 col-xs-12" style="padding-top: 7px">
                                <ul style="margin: 0px;padding: 0px">
                                    <li th:each="right1 : ${rights}" th:if="${right1.getRightType() == 'Folder'}" style="list-style: none">
                                        <a>
                                            <input type="checkbox" name="rightCodes" th:value="${right1.rightCode}">
                                            <span th:text="${right1.rightText}">一级菜单</span>
                                        </a>
                                        <ul>
                                            <li style="list-style: none" th:each="right2 : ${rights}" th:if="${right2.getRightType() == 'Document' && right2.rightParentCode == right1.rightCode}">
                                                <a>
                                                    <input type="checkbox" name="rightCodes" th:value="${right2.rightCode}">
                                                    <span th:text="${right2.rightText}">二级菜单</span>
                                                </a>
                                                <ul>
                                                    <li style="list-style: none" th:each="right3 : ${rights}" th:if="${right3.getRightType() == 'Button' && right3.rightParentCode == right2.rightCode}">
                                                        <a>
                                                            <input type="checkbox" name="rightCodes" th:value="${right3.rightCode}">
                                                            <span th:text="${right3.rightText}">三级菜单</span>
                                                        </a>
                                                    </li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="ln_solid"></div>
                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-3">
                                <button id="send" type="submit" class="btn btn-success">保存</button>
                                <button type="button" class="btn btn-primary" id="back"
                                        onclick="javascript:window.history.back();">返回
                                </button>
                                <br/><br/>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>